.class public Lcom/android/apps/pros/b;
.super Ljava/lang/Object;
.source "LocalHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/apps/pros/b$c;
    }
.end annotation


# static fields
.field static a:Lcom/android/apps/pros/a;

.field static b:Z

.field static c:Landroid/os/Handler;

.field private static d:Landroid/content/ServiceConnection;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    new-instance v0, Lcom/android/apps/pros/b$a;

    invoke-direct {v0}, Lcom/android/apps/pros/b$a;-><init>()V

    sput-object v0, Lcom/android/apps/pros/b;->d:Landroid/content/ServiceConnection;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic a(Landroid/content/Context;)Lcom/android/apps/pros/a;
    .locals 0

    .line 1
    invoke-static {p0}, Lcom/android/apps/pros/b;->b(Landroid/content/Context;)Lcom/android/apps/pros/a;

    move-result-object p0

    return-object p0
.end method

.method static a(Landroid/content/Context;I)V
    .locals 2

    .line 2
    new-instance v0, Lcom/android/apps/pros/b$c;

    invoke-direct {v0, p0, p1}, Lcom/android/apps/pros/b$c;-><init>(Landroid/content/Context;I)V

    if-eqz p1, :cond_1

    const/4 p0, 0x6

    if-ne p1, p0, :cond_0

    goto :goto_0

    :cond_0
    const/4 p0, 0x0

    new-array p0, p0, [Ljava/lang/Void;

    .line 3
    invoke-virtual {v0, p0}, Landroid/os/AsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto :goto_2

    .line 4
    :cond_1
    :goto_0
    sget-object p0, Lcom/android/apps/pros/b;->c:Landroid/os/Handler;

    if-nez p0, :cond_3

    .line 5
    const-class p0, Lcom/android/apps/pros/b;

    monitor-enter p0

    .line 6
    :try_start_0
    sget-object p1, Lcom/android/apps/pros/b;->c:Landroid/os/Handler;

    if-nez p1, :cond_2

    .line 7
    new-instance p1, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {p1, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    sput-object p1, Lcom/android/apps/pros/b;->c:Landroid/os/Handler;

    .line 8
    :cond_2
    monitor-exit p0

    goto :goto_1

    :catchall_0
    move-exception p1

    monitor-exit p0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p1

    .line 9
    :cond_3
    :goto_1
    sget-object p0, Lcom/android/apps/pros/b;->c:Landroid/os/Handler;

    new-instance p1, Lcom/android/apps/pros/b$b;

    invoke-direct {p1, v0}, Lcom/android/apps/pros/b$b;-><init>(Lcom/android/apps/pros/b$c;)V

    const-wide/16 v0, 0xbb8

    invoke-virtual {p0, p1, v0, v1}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    :goto_2
    return-void
.end method

.method private static b(Landroid/content/Context;)Lcom/android/apps/pros/a;
    .locals 4

    .line 1
    const-class v0, Lcom/android/apps/pros/b;

    monitor-enter v0

    .line 2
    :try_start_0
    sget-object v1, Lcom/android/apps/pros/b;->a:Lcom/android/apps/pros/a;

    if-nez v1, :cond_1

    .line 3
    sget-boolean v1, Lcom/android/apps/pros/b;->b:Z

    if-nez v1, :cond_0

    const/4 v1, 0x1

    .line 4
    sput-boolean v1, Lcom/android/apps/pros/b;->b:Z

    .line 5
    new-instance v2, Landroid/content/Intent;

    invoke-direct {v2}, Landroid/content/Intent;-><init>()V

    .line 6
    const-class v3, Lcom/android/apps/pros/LocalMService;

    invoke-virtual {v2, p0, v3}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;

    .line 7
    sget-object v3, Lcom/android/apps/pros/b;->d:Landroid/content/ServiceConnection;

    invoke-virtual {p0, v2, v3, v1}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 8
    :cond_0
    :try_start_1
    invoke-virtual {v0}, Ljava/lang/Object;->wait()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 9
    :catch_0
    :cond_1
    :try_start_2
    sget-object p0, Lcom/android/apps/pros/b;->a:Lcom/android/apps/pros/a;

    monitor-exit v0

    return-object p0

    :catchall_0
    move-exception p0

    .line 10
    monitor-exit v0
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw p0
.end method

.method static c(Landroid/content/Context;)V
    .locals 5

    const-string v0, "alarm"

    .line 1
    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/AlarmManager;

    .line 2
    new-instance v1, Landroid/content/Intent;

    const-class v2, Lcom/android/apps/pros/LocalAReceiver;

    invoke-direct {v1, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const/4 v2, 0x0

    const/high16 v3, 0x8000000

    .line 3
    invoke-static {p0, v2, v1, v3}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p0

    .line 4
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    const-wide/32 v3, 0x36ee80

    add-long/2addr v1, v3

    const/4 v3, 0x1

    invoke-virtual {v0, v3, v1, v2, p0}, Landroid/app/AlarmManager;->set(IJLandroid/app/PendingIntent;)V

    return-void
.end method
